<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <!-- INTERFACE -->
    <cc:interface>
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>
        <p:dataTable id="#{cc.id}"  value="#{bookKeepingSummery.opdList}" var="d" 
                     rendered="#{bookKeepingSummery.opdList.size()>0}">                   
            <f:facet name="header">
                <h:panelGrid columns="2" styleClass="printBlock" style="min-width: 100%;">
                    <p:outputLabel value="#{sessionController.institution.name}"/><h:outputLabel/>
                    <p:outputLabel value="Book Keeping Summary"/><h:outputLabel/>   
                    <h:outputLabel/><h:outputLabel/>
                    <h:panelGroup>
                        <h:outputLabel value="From : "  />
                        <h:outputLabel  value="#{bookKeepingSummery.fromDate}" >
                            <f:convertDateTime pattern="dd MM yy hh:mm a"/>
                        </h:outputLabel>
                    </h:panelGroup>
                    <h:panelGroup>
                        <h:outputLabel value="To : "/> 
                        <h:outputLabel  value="#{bookKeepingSummery.toDate}" style="float: right" >
                            <f:convertDateTime pattern="dd MM yy hh:mm a"/>
                        </h:outputLabel>
                    </h:panelGroup>
                </h:panelGrid>
                <h:outputLabel value="OPD Service"/>     

            </f:facet>       
            <p:column headerText="Item Name" style="text-align: left;">
                <h:outputLabel value="#{d.string}" rendered="#{d.summery eq false}" />
                <h:outputLabel value="#{d.string}" rendered="#{d.summery eq true}" style="font-weight: bold;" />
            </p:column>                   
            <p:column headerText="Count">
                <h:outputLabel value="#{d.value1}" />
            </p:column>
            <p:column style="text-align: right;"  headerText="Hospital Fee">                               
                <h:outputLabel value="#{d.value2}" rendered="#{d.summery eq false}" >
                    <f:convertNumber pattern="#,##0.00"/>
                </h:outputLabel>
            </p:column>   
            <p:column style="text-align: right;"  headerText="Professional Fee">                               
                <h:outputLabel value="#{d.value3}" rendered="#{d.summery eq false}" >
                    <f:convertNumber pattern="#,##0.00"/>
                </h:outputLabel>
            </p:column>  
            <p:column headerText="Sub Total" style="text-align: right;">
                <h:outputLabel value="#{d.value3}" rendered="#{d.summery eq true}" style="font-weight: bold;">
                    <f:convertNumber pattern="#,##0.00"/>
                </h:outputLabel>
            </p:column>
            <p:columnGroup type="footer">
                <p:row>
                    <p:column colspan="4" footerText="Total OPD Service Collection"/>
                    <p:column style="text-align: right;" footerText="#{bookKeepingSummery.opdHospitalTotal}" >
                        <f:facet name="footer">
                            <h:outputLabel value="#{bookKeepingSummery.opdHospitalTotal}">
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                        </f:facet>
                    </p:column>
                </p:row>
            </p:columnGroup>


        </p:dataTable> 
    </cc:implementation>
</html>